package com.example.hospital.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.hospital.dto.PharmacyinventoryQuery;
import com.example.hospital.entity.Pharmacyinventory;
import com.example.hospital.service.PharmacyinventoryService;
import com.example.hospital.mapper.PharmacyinventoryMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Oreki
 * @description 针对表【pharmacyinventory】的数据库操作Service实现
 * @createDate 2024-12-27 16:53:20
 */
@Service
public class PharmacyinventoryServiceImpl extends ServiceImpl<PharmacyinventoryMapper, Pharmacyinventory>
        implements PharmacyinventoryService {

    @Override
    public List<Pharmacyinventory> listPharmacyinventorys(PharmacyinventoryQuery pharmacyinventoryQuery) {
        if (pharmacyinventoryQuery == null) {
            return this.list();
        }
        String medicationName = pharmacyinventoryQuery.getMedicationName();
        return this.lambdaQuery().like(Pharmacyinventory::getMedicationName, medicationName).list();
    }
}




